package com.yygo.jobs;

import com.yygo.model.LoanRequest;
import com.yygo.model.Rule;
import com.yygo.service.LoanRequestManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * Created by tiansha on 2015/7/9.
 */
@Component("F001")
public class F001 extends BaseRuleProcessor implements RuleProcessor {

    @Autowired
    private LoanRequestManager loanRequestManager;

    @Override
    public Rule process(LoanRequest loanRequest) {
        List<LoanRequest> list = getMobileRequests(loanRequest);
        if (list.size() > 0) {
            Rule rule = new Rule("F001", "申请人手机号码与关联单号一致");
            rule.setUrl("related");
            List<String> numbers = getNumbers(list);
            rule.getNumbers().addAll(numbers);
            return rule;
        }
        return null;
    }
}
